package cn.kuporo.seckill.goods.application.cacahe;

import cn.kuporo.seckill.common.cache.model.SeckillBusinessCache;
import cn.kuporo.seckill.common.cache.service.SeckillCacheService;
import cn.kuporo.seckill.goods.domain.model.SeckillGoods;

/**
 * @author: kuporo
 * @since: 2025/7/9
 * @description:
 */
public interface SeckillGoodsCacheService extends SeckillCacheService {
    /**
     * 获取商品信息
     */
    SeckillBusinessCache<SeckillGoods> getSeckillGoods(Long goodsId, Long version);

    /**
     * 更新缓存
     */
    SeckillBusinessCache<SeckillGoods> tryUpdateSeckillGoodsCacheByLock(Long goodsId, boolean doubleCheck);

    /**
     * 获取商品的可用库存
     */
    SeckillBusinessCache<Integer> getAvailableStock(Long goodsId, Long version);
}
